package se.webbzon.boltzmann.battle.battleaction.buffdamage;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import se.webbzon.boltzmann.battle.battleaction.BattleAction;
import se.webbzon.boltzmann.battle.battleaction.BattleActionFactory;
import se.webbzon.boltzmann.battle.group.BattleGroup;
import se.webbzon.boltzmann.battle.object.npc.BattleNPC;
import se.webbzon.boltzmann.battle.property.BattleBuffType;
import se.webbzon.oschi01.worldarea.WorldArea;

public class BuffDamageActionFactory extends BattleActionFactory {
	
	// The type of the battle buff
	private final BattleBuffType type;
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new buff damage action factory of a given battle
	 * buff type. **/
	public BuffDamageActionFactory(BattleBuffType type) {
		this.type = type;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public int targets(Collection<BattleGroup> all, BattleNPC caster) {
		return 1;
	}

	@Override public List<BattleNPC> getTarget(	Collection<BattleGroup> all, 
												BattleNPC caster, int n) {
		ArrayList<BattleNPC> targets = new ArrayList<BattleNPC>();
		targets.add(caster);
		return targets;
	}

	@Override public BattleAction makeBattleAction(	WorldArea world,
													BattleNPC caster,
													List<BattleNPC> targets) {
		return new BuffDamageAction(world, caster,targets,type);
	}

	@Override public boolean hasIcon() {
		return false;
	}

}
